package com.lvwenguo.controller.input;

import com.lvwenguo.service.PurchaseServiceInter;
import com.lvwenguo.service.serviceImple.PurchaseServiceImple;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

//商品录入功能,数据回显
@WebServlet(urlPatterns = "/InputProduct/purchase/purchase_input")
public class InputProductServlert extends HttpServlet {
    PurchaseServiceInter purchaseServiceImpol =new PurchaseServiceImple();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //查询供应商信息
        req.setAttribute("SupplierName", purchaseServiceImpol.selectSupplierName());
        //查询品类信息
        req.setAttribute("CategoryName", purchaseServiceImpol.selectCategoryName());

        req.getRequestDispatcher("/view/purchase/purchase_input.jsp").forward(req,resp);

    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        this.doGet(req,resp);
    }
}
